import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/product_detail_entity.dart';

ProductDetailEntity $ProductDetailEntityFromJson(Map<String, dynamic> json) {
	final ProductDetailEntity productDetailEntity = ProductDetailEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		productDetailEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		productDetailEntity.msg = msg;
	}
	final ProductDetailData? data = jsonConvert.convert<ProductDetailData>(json['data']);
	if (data != null) {
		productDetailEntity.data = data;
	}
	return productDetailEntity;
}

Map<String, dynamic> $ProductDetailEntityToJson(ProductDetailEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

ProductDetailData $ProductDetailDataFromJson(Map<String, dynamic> json) {
	final ProductDetailData productDetailData = ProductDetailData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		productDetailData.id = id;
	}
	final String? mainImg = jsonConvert.convert<String>(json['main_img']);
	if (mainImg != null) {
		productDetailData.mainImg = mainImg;
	}
	final List<String>? img = jsonConvert.convertListNotNull<String>(json['img']);
	if (img != null) {
		productDetailData.img = img;
	}
	final String? salesNum = jsonConvert.convert<String>(json['sales_num']);
	if (salesNum != null) {
		productDetailData.salesNum = salesNum;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		productDetailData.name = name;
	}
	final String? storeId = jsonConvert.convert<String>(json['store_id']);
	if (storeId != null) {
		productDetailData.storeId = storeId;
	}
	final String? areaId = jsonConvert.convert<String>(json['area_id']);
	if (areaId != null) {
		productDetailData.areaId = areaId;
	}
	final String? integral = jsonConvert.convert<String>(json['integral']);
	if (integral != null) {
		productDetailData.integral = integral;
	}
	final String? price = jsonConvert.convert<String>(json['price']);
	if (price != null) {
		productDetailData.price = price;
	}
	final String? tag = jsonConvert.convert<String>(json['tag']);
	if (tag != null) {
		productDetailData.tag = tag;
	}
	final String? detail = jsonConvert.convert<String>(json['detail']);
	if (detail != null) {
		productDetailData.detail = detail;
	}
	final String? storeExpressMoney = jsonConvert.convert<String>(json['store_express_money']);
	if (storeExpressMoney != null) {
		productDetailData.storeExpressMoney = storeExpressMoney;
	}
	final ProductDetailDataStore? store = jsonConvert.convert<ProductDetailDataStore>(json['store']);
	if (store != null) {
		productDetailData.store = store;
	}
	final String? money = jsonConvert.convert<String>(json['money']);
	if (money != null) {
		productDetailData.money = money;
	}
	final String? money1 = jsonConvert.convert<String>(json['money1']);
	if (money1 != null) {
		productDetailData.money1 = money1;
	}
	final String? company = jsonConvert.convert<String>(json['company']);
	if (company != null) {
		productDetailData.company = company;
	}
	final String? company1 = jsonConvert.convert<String>(json['company1']);
	if (company1 != null) {
		productDetailData.company1 = company1;
	}
	final String? allowPayStr = jsonConvert.convert<String>(json['allow_pay_str']);
	if (allowPayStr != null) {
		productDetailData.allowPayStr = allowPayStr;
	}
	final List<ProductDetailDataSku>? sku = jsonConvert.convertListNotNull<ProductDetailDataSku>(json['sku']);
	if (sku != null) {
		productDetailData.sku = sku;
	}
	final List<ProductDetailDataSpec>? spec = jsonConvert.convertListNotNull<ProductDetailDataSpec>(json['spec']);
	if (spec != null) {
		productDetailData.spec = spec;
	}
	final String? func = jsonConvert.convert<String>(json['func']);
	if (func != null) {
		productDetailData.func = func;
	}
	final String? isSave = jsonConvert.convert<String>(json['is_save']);
	if (isSave != null) {
		productDetailData.isSave = isSave;
	}
	return productDetailData;
}

Map<String, dynamic> $ProductDetailDataToJson(ProductDetailData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['main_img'] = entity.mainImg;
	data['img'] =  entity.img;
	data['sales_num'] = entity.salesNum;
	data['name'] = entity.name;
	data['store_id'] = entity.storeId;
	data['area_id'] = entity.areaId;
	data['integral'] = entity.integral;
	data['price'] = entity.price;
	data['tag'] = entity.tag;
	data['detail'] = entity.detail;
	data['store_express_money'] = entity.storeExpressMoney;
	data['store'] = entity.store.toJson();
	data['money'] = entity.money;
	data['money1'] = entity.money1;
	data['company'] = entity.company;
	data['company1'] = entity.company1;
	data['allow_pay_str'] = entity.allowPayStr;
	data['sku'] =  entity.sku.map((v) => v.toJson()).toList();
	data['spec'] =  entity.spec.map((v) => v.toJson()).toList();
	data['func'] = entity.func;
	data['is_save'] = entity.isSave;
	return data;
}

ProductDetailDataStore $ProductDetailDataStoreFromJson(Map<String, dynamic> json) {
	final ProductDetailDataStore productDetailDataStore = ProductDetailDataStore();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		productDetailDataStore.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		productDetailDataStore.name = name;
	}
	final String? logo = jsonConvert.convert<String>(json['logo']);
	if (logo != null) {
		productDetailDataStore.logo = logo;
	}
	return productDetailDataStore;
}

Map<String, dynamic> $ProductDetailDataStoreToJson(ProductDetailDataStore entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['logo'] = entity.logo;
	return data;
}

ProductDetailDataSku $ProductDetailDataSkuFromJson(Map<String, dynamic> json) {
	final ProductDetailDataSku productDetailDataSku = ProductDetailDataSku();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		productDetailDataSku.id = id;
	}
	final String? goodsId = jsonConvert.convert<String>(json['goods_id']);
	if (goodsId != null) {
		productDetailDataSku.goodsId = goodsId;
	}
	final List<String>? specKey = jsonConvert.convertListNotNull<String>(json['spec_key']);
	if (specKey != null) {
		productDetailDataSku.specKey = specKey;
	}
	final List<String>? specVal = jsonConvert.convertListNotNull<String>(json['spec_val']);
	if (specVal != null) {
		productDetailDataSku.specVal = specVal;
	}
	final String? stock = jsonConvert.convert<String>(json['stock']);
	if (stock != null) {
		productDetailDataSku.stock = stock;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		productDetailDataSku.imgPath = imgPath;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		productDetailDataSku.status = status;
	}
	final String? price = jsonConvert.convert<String>(json['price']);
	if (price != null) {
		productDetailDataSku.price = price;
	}
	final String? sales = jsonConvert.convert<String>(json['sales']);
	if (sales != null) {
		productDetailDataSku.sales = sales;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		productDetailDataSku.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		productDetailDataSku.updatedAt = updatedAt;
	}
	final String? integral = jsonConvert.convert<String>(json['integral']);
	if (integral != null) {
		productDetailDataSku.integral = integral;
	}
	final String? allowPayStr = jsonConvert.convert<String>(json['allow_pay_str']);
	if (allowPayStr != null) {
		productDetailDataSku.allowPayStr = allowPayStr;
	}
	final String? money = jsonConvert.convert<String>(json['money']);
	if (money != null) {
		productDetailDataSku.money = money;
	}
	final String? money1 = jsonConvert.convert<String>(json['money1']);
	if (money1 != null) {
		productDetailDataSku.money1 = money1;
	}
	final String? company = jsonConvert.convert<String>(json['company']);
	if (company != null) {
		productDetailDataSku.company = company;
	}
	final String? company1 = jsonConvert.convert<String>(json['company1']);
	if (company1 != null) {
		productDetailDataSku.company1 = company1;
	}
	return productDetailDataSku;
}

Map<String, dynamic> $ProductDetailDataSkuToJson(ProductDetailDataSku entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['goods_id'] = entity.goodsId;
	data['spec_key'] =  entity.specKey;
	data['spec_val'] =  entity.specVal;
	data['stock'] = entity.stock;
	data['img_path'] = entity.imgPath;
	data['status'] = entity.status;
	data['price'] = entity.price;
	data['sales'] = entity.sales;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['integral'] = entity.integral;
	data['allow_pay_str'] = entity.allowPayStr;
	data['money'] = entity.money;
	data['money1'] = entity.money1;
	data['company'] = entity.company;
	data['company1'] = entity.company1;
	return data;
}

ProductDetailDataSpec $ProductDetailDataSpecFromJson(Map<String, dynamic> json) {
	final ProductDetailDataSpec productDetailDataSpec = ProductDetailDataSpec();
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		productDetailDataSpec.name = name;
	}
	final List<String>? items = jsonConvert.convertListNotNull<String>(json['items']);
	if (items != null) {
		productDetailDataSpec.items = items;
	}
	return productDetailDataSpec;
}

Map<String, dynamic> $ProductDetailDataSpecToJson(ProductDetailDataSpec entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['name'] = entity.name;
	data['items'] =  entity.items;
	return data;
}